package com.imcode.listdemo;

import java.util.ArrayList;
import java.util.List;

public class ArrayListDemo03 {

    public static void main(String[] args) {
        List<User> list = new ArrayList<>();
        User u1 = new User(1,"张三");
        User u2 = new User(2,"李四");
        User u3 = new User(3,"王五");
        list.add(u1);
        list.add(u2);
        list.add(u3);
        System.out.println(list);
        User u4 = new User(1,"张三");
        boolean r = list.remove(u4);
        System.out.println(r);// true
        System.out.println(list);
    }
}
